home *** CD-ROM | disk | FTP | other *** search
- DISK DIRECTORIES II:
- RECOVERING FROM PASS "N:NAME"
- by Phyrne Bacon
-
- DISK'EDITOR and DIRECTORY'PROBE can
- be used together to recover files
- lost by accidentally typing a short
- new; that is:
-
- pass "n:name" // without any id
-
- Don't save anything on the disk with
- the missing files until the error has
- been corrected! If you haven't got a
- backup disk, now is the time to make
- one. Use a whole disk copier such as
- four minute backup. Put the original
- disk in a safe place, and work on the
- backup. We will call the backup "the
- damaged disk".
-
- In Disk Directories I: Unscratching
- Files, we explained about disk
- directory files, directory entries,
- program block chains, unscratching
- files, and correcting the BAM.
-
- I. Recovering from pass"n:name"
-
- Now suppose that you used
- pass"n:name" (without any id) by
- accident on both your disk and its
- backup. (It has happened to me!) If
- you used pass"n:name,id", your files
- cannot be recovered.
-
- The sectors in the directory are
- chained like those in a program. Look
- at track 18, sector 4. If it has any
- entries (even scratched ones), the
- first two bytes of block 18-1 should
- be 18 and 4 (12 and 04 in hex). If
- 18-4 has directory entries, and the
- first two bytes of 18-1 are not 18
- and 4, use DISK'EDITOR to change
- these two bytes. Remember to save
- 18-1 after you make each set of
- changes.
-
- If you changed the first two bytes of
- 18-1 to 18 and 4, use pass"v" to
- correct the BAM, and you will have
- recovered all the files on the disk
- except those whose entries were in
- 18-1.
-
- Sector 18-1 has zeros everywhere
- except the second byte (which is
- 255), and reconstructing the first
- eight entries may be extremely
- difficult.
-
- II. Restoring file entries.
-
- Begin by running DIRECTORY PROBE with
- the damaged disk, and ask for the
- fragments and answer no to "complete
- block chains?". Unless you have saved
- something on the disk since the
- pass"n:name", your missing files
- should all be listed in the list of
- fragments at the end of the printout
- along with parts of previously
- scratched programs.
-
- You have to find out which ones (if
- any) are the missing files.
-
- Take a new disk, and format it by
- typing pass"n:new disk,zq". It should
- have a different id from the damaged
- disk.
-
- Then save the one-line program:
- 10 print"hi
- nine times on the new disk. Use the
- filenames "a1" through "a9".
-
- Copy block 18-1 of the new disk onto
- block 18-1 of the damaged disk by
- using DISK'EDITOR load and save. If
- there are no entries in block 18-4
- change the first two bytes of 18-1 of
- the damaged disk to 0 and 255 (00 ff
- in hex).
-
- Now we need to choose the most likely
- fragments and to change the
- track/sector of each directory entry
- in block 18-1 on the damaged disk to
- the track/sector of one of the chosen
- chain fragments. Label the chosen
- fragments as a1-a8 on the printout.
-
- Use DISK'EDITOR to help choose the
- fragments. A first block of a listed
- COMAL program will be easy to read in
- the right column. A COMAL 2.0 program
- will begin with the hex bytes: ff ff
- 02 00 00, but remember that the first
- two bytes of the block are not part
- of the program; so that it is the
- third and fourth bytes which are ff
- ff in hex. Almost all BASIC programs
- begin with the hex bytes: 01 08. A
- COMAL 0.14 program may be
- recognizable if its name appears in a
- remark near the beginning. The line
- number # of the first line of a COMAL
- 0.14 program appears in the first and
- second columns of the second row in
- high-byte/low-byte form (# = hi*256 +
- lo). The third column contains the
- link number: where the next line
- starts. If the fourth column of the
- second row contains 00 in hex, the
- first line is a remark.
-
- Say the fragment begins on 17-0
- (track 17 sector 0). Change the
- fourth byte of the directory entry to
- 17 and the fifth to 0. To enter 17,
- move the cursor to the correct
- position, press n, enter 17, and
- press return. Usually the first files
- saved begin in tracks near the
- directory track, that is, near track
- 18. If you wonder if a fragment is a
- file of a certain type, compare its
- first block or so to a known file of
- that type. Guess a file type for each
- file and enter the guess on the disk
- and the printout.
-
- DIRECTORY PROBE printed the chain
- length for the fragment (the number
- of blocks in the file), say 8. Change
- the byte in the seventh column of the
- last row of the directory entry to 8
- (or whatever).
-
- Give each of the files a temporary
- name on the disk and on the printout,
- and use a file copying program to
- copy the eight files from the damaged
- disk to the new disk. Check the
- files. You may need to change your
- guess as to the file type. Incomplete
- COMAL 0.14 files usually crash COMAL.
- Be sure this hasn't happened before
- testing another COMAL 0.14 fragment
- file.
-
- If there were more than eight block
- chain fragments, repeat the process
- for the next eight fragments if you
- haven't found your missing files.
-
- When you are finished, use pass"v" on
- the damaged disk to update the BAM,
- and use cat to check the disk
- directory. Your files may need to be
- moved to the same disk.
-
- If you have trouble making this
- method work, you may want to practice
- by making a copy of disk, say LAKE,
- similar to the damaged disk, use
- pass"n:sea" on LAKE, and then work on
- SEA where the correct answers are on
- LAKE.
-
- III. Excessive noise from disk drive.
-
- Frequently disk drives are out of
- alignment and the disk drives have
- trouble reading and writing near the
- outer tracks: 1 and 35. If you asked
- for fragments in DIRECTORY'PROBE, and
- the the disk drive makes a great deal
- of noise when the screen says
- "reading track 1", stop the program,
- and, in the procedure frag, change
- the limits on both of the lines "for
- g#:=1 to 35 do" to "for g#:=2 to 35
- do". Repeat this process if
- necessary.
-
- With luck, all of the disk block
- chain fragments will still appear on
- the printout, and you will be able to
- recover all your files.
-
- IV. More information.
-
- An excellent source of further
- information is:
-
- INSIDE COMMODORE DOS by R. Immers and
- G. Neufield ($19.95, Datamost)
-